package com.whfc.hdc.dao;

import com.whfc.hdc.dto.AppDeviceUpgradePackageDTO;
import com.whfc.hdc.entity.AppDeviceUpgradePackage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AppDeviceUpgradePackageMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppDeviceUpgradePackage record);

    int insertSelective(AppDeviceUpgradePackage record);

    AppDeviceUpgradePackage selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppDeviceUpgradePackage record);

    int updateByPrimaryKey(AppDeviceUpgradePackage record);

    /**
     * 查询升级包列表
     *
     * @param deviceType
     * @return
     */
    List<AppDeviceUpgradePackageDTO> selectPackageList(@Param("deviceType") Integer deviceType);

    /**
     * 逻辑删除
     *
     * @param id
     * @return
     */
    int logicDeleteById(@Param("id") Integer id);

    /**
     * 统计升级包数量
     *
     * @param deviceType
     * @param masterVer
     * @return
     */
    int countByDeviceTypeAndMasterVer(@Param("deviceType") Integer deviceType, @Param("masterVer") String masterVer);

    /**
     * 统计升级包数量
     *
     * @param deviceType
     * @param slaveVer
     * @return
     */
    int countByDeviceTypeAndSlaveVer(@Param("deviceType") Integer deviceType, @Param("slaveVer") String slaveVer);
}